package cn.bsuc.infirmary.domain;

import cn.bsuc.infirmary.util.JSONResult;
import cn.bsuc.infirmary.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;

@Getter
@Setter
public class Student extends Basedomain {
    //男
    public static final int GENDER_MAN = 1;
    //女
    public static final int GENDER_WOMAN = 0;

    private String username;

    private String password;

    private Long usermoney;

    private Date regtime;

    private Integer age;

    private Integer gender=GENDER_MAN;

    private String tel;

    private String qq;

    private String email;

    public String getJson() {
        HashMap<String, Object> map = new HashMap<>();
        return JSONUtil.toJSONString(map);
    }
    public String getGendarName() {
        String temp = "未知";
        if (gender == GENDER_MAN) {
            temp = "男";
        } else if (gender == GENDER_WOMAN) {
            temp = "女";
        }
        return temp;
    }
}